Optimal. Leaf size=46 \[ \frac {\log (\cosh (c+d x))}{(a+b) d}-\frac {a \log \left (a+b \tanh ^2(c+d x)\right )}{2 b (a+b) d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3751, 457, 78}
\begin {gather*} \frac {\log (\cosh (c+d x))}{d (a+b)}-\frac {a \log \left (a+b \tanh ^2(c+d x)\right )}{2 b d (a+b)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 457
Rule 3751
Rubi steps
\begin {align*} \int \frac {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx &=\frac {\text {Subst}\left (\int \frac {x^3}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \frac {x}{(1-x) (a+b x)} \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac {\text {Subst}\left (\int \left (-\frac {1}{(a+b) (-1+x)}-\frac {a}{(a+b) (a+b x)}\right ) \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac {\log (\cosh (c+d x))}{(a+b) d}-\frac {a \log \left (a+b \tanh ^2(c+d x)\right )}{2 b (a+b) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 42, normalized size = 0.91 \begin {gather*} \frac {2 b \log (\cosh (c+d x))-a \log \left (a+b \tanh ^2(c+d x)\right )}{2 a b d+2 b^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.69, size = 70, normalized size = 1.52
method | result | size |
derivativedivides | \(\frac {-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 b +2 a}-\frac {a \ln \left (a +b \left (\tanh ^{2}\left (d x +c \right )\right )\right )}{2 \left (a +b \right ) b}-\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{2 b +2 a}}{d}\) | \(70\) |
default | \(\frac {-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 b +2 a}-\frac {a \ln \left (a +b \left (\tanh ^{2}\left (d x +c \right )\right )\right )}{2 \left (a +b \right ) b}-\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{2 b +2 a}}{d}\) | \(70\) |
risch | \(\frac {x}{a +b}-\frac {2 x}{b}-\frac {2 c}{b d}+\frac {2 a x}{b \left (a +b \right )}+\frac {2 a c}{b d \left (a +b \right )}+\frac {\ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{b d}-\frac {a \ln \left ({\mathrm e}^{4 d x +4 c}+\frac {2 \left (a -b \right ) {\mathrm e}^{2 d x +2 c}}{a +b}+1\right )}{2 b d \left (a +b \right )}\) | \(117\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 82, normalized size = 1.78 \begin {gather*} -\frac {a \log \left (2 \, {\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{2 \, {\left (a b + b^{2}\right )} d} + \frac {d x + c}{{\left (a + b\right )} d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{b d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 118 vs.
\(2 (44) = 88\).
time = 0.39, size = 118, normalized size = 2.57 \begin {gather*} -\frac {2 \, b d x + a \log \left (\frac {2 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{2} + {\left (a + b\right )} \sinh \left (d x + c\right )^{2} + a - b\right )}}{\cosh \left (d x + c\right )^{2} - 2 \, \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + \sinh \left (d x + c\right )^{2}}\right ) - 2 \, {\left (a + b\right )} \log \left (\frac {2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right )}{2 \, {\left (a b + b^{2}\right )} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 306 vs.
\(2 (36) = 72\).
time = 4.28, size = 306, normalized size = 6.65 \begin {gather*} \begin {cases} \tilde {\infty } x \tanh {\left (c \right )} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {x - \frac {\log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {\tanh ^{2}{\left (c + d x \right )}}{2 d}}{a} & \text {for}\: b = 0 \\\frac {2 d x \tanh ^{2}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {2 d x}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {2 \log {\left (\tanh {\left (c + d x \right )} + 1 \right )} \tanh ^{2}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} + \frac {2 \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} + \frac {1}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} & \text {for}\: a = - b \\\frac {x \tanh ^{3}{\left (c \right )}}{a + b \tanh ^{2}{\left (c \right )}} & \text {for}\: d = 0 \\- \frac {a \log {\left (- \sqrt {- \frac {a}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 a b d + 2 b^{2} d} - \frac {a \log {\left (\sqrt {- \frac {a}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 a b d + 2 b^{2} d} + \frac {2 b d x}{2 a b d + 2 b^{2} d} - \frac {2 b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{2 a b d + 2 b^{2} d} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 96 vs.
\(2 (44) = 88\).
time = 0.46, size = 96, normalized size = 2.09 \begin {gather*} -\frac {\frac {a \log \left (a e^{\left (4 \, d x + 4 \, c\right )} + b e^{\left (4 \, d x + 4 \, c\right )} + 2 \, a e^{\left (2 \, d x + 2 \, c\right )} - 2 \, b e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}{a b + b^{2}} + \frac {2 \, {\left (d x + c\right )}}{a + b} - \frac {2 \, \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}{b}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.24, size = 46, normalized size = 1.00 \begin {gather*} -\frac {\frac {a\,\ln \left (b\,{\mathrm {tanh}\left (c+d\,x\right )}^2+a\right )}{2}+b\,\left (\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )-d\,x\right )}{b\,d\,\left (a+b\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________